Script to fetch logs over the network#381
Conversation
- Parallel scp jobs with configurable throttle (default 4) - Unified launch+collect loop so [done] messages appear throughout - Write-Progress bar tracking bytes written to disk by in-flight transfers - chacha20/aes128-ctr cipher preference for faster transfers on roboRIO ARM CPU - robot-logs/ output directory added to .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rokadias
left a comment
There was a problem hiding this comment.
Not something that would typically pass my code review on powershell or bash scripting, but I don't see anything that would break here either.
Just change the pull from the remote directory unless you're sure the path would work.
|
|
||
| $Robot = "roboRIO-488-frc.local" | ||
| $User = "admin" | ||
| $RemoteLogDir = "/u/logs" # roboRIO mounts USB at /u |
There was a problem hiding this comment.
I don't know if I believe this (I've seen it mention in wpilib docs though), but from what I've seen which makes more sense in terms of typical linux location, and where I've pulled them from it's:
/media/sda1/logs
| [int]$Throttle = 4 | ||
| ) | ||
|
|
||
| $Robot = "roboRIO-488-frc.local" |
There was a problem hiding this comment.
⭐ ⭐
I don't know if mdns works on the driver station, but there's no reason to use mdns for the rio.
10.4.88.2 this has to be the ip so this will also rule out any issues/slowness due to dns lookup.
There was a problem hiding this comment.
It can be 172.22.11.2 if you've connected over USB.
|
Also made a linux based one so that those who have linux systems can copy easily. |
|
Not particularly related to this, but should we also consider some script in the future to wipe previous logs on USBs in case if they ever get full and we forget to clean them? |
It's a good question to ask. You can typically make one that runs to go clean it up. Though I think the file sizes are relatively small and would probably take more than a full season to fill up. The way you would write this in linux are the following then you could either write a script here that performs a remote connection similar to the script here or make a cronjob that automatically runs at a particular interval. find /media/sda1/logs -mtime +7 -deleteThe find portion would look for all files under the Some safer ways are the following: find /media/sda1/logs -mtime +7 | xargs rm -rf
find /media/sda1/logs -mtime +7 -exec rm -f {} \; |
Summary
Written by Claude.
Adds a PowerShell script (fetch-logs.ps1) for pulling .wpilog files off the robot's USB key after a match or
practice session.
re-run without re-fetching everything
overhead across files
within each file — no more silent waiting
ARM CPU that lacks hardware AES acceleration
Usage
Download new/changed logs to .\robot-logs\
.\fetch-logs.ps1
Specify a destination
.\fetch-logs.ps1 -Destination C:\logs\match1
Re-download everything
.\fetch-logs.ps1 -Force
Limit to 2 parallel transfers
.\fetch-logs.ps1 -Throttle 2
Requires the robot to be connected (Ethernet or WiFi) with a USB key inserted at /u/logs.